package com.atcumt.shengce;

import java.util.Arrays;

class P{
    void f(int i) {
        System.out.println(i);
    }
}
class Q extends P{
    void f(int i) {
        System.out.println(i*2);
    }
}
public class Test {
    
    
    public static void main(String[] args) {
        P x = new Q();
        Q y = new Q();
        P z = new Q();
        x.f(1);
        y.f(1);
        z.f(1);
    }
    public int maxDigit (int[] digits) {
        // write code here
        int n = digits.length;
        Arrays.sort(digits);
        String[] str = new String[n];
        for (int i = n - 1; i >= 0; i++) {
            str[i] = String.valueOf(digits[i]);
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            sb.append(str[i]);
        }
        while (sb.charAt(0) == '0') {
            sb.deleteCharAt(0);
            
            if (sb.length() == 0) {
                return 0;
            }
        }
        String s = sb.reverse().toString();
        int res = Integer.parseInt(s);
        return res;
    }

    public long tourismRoutePlanning (int scenicspot) {
        // write code here
        if (scenicspot == 1) {
            return 1;
        }
        long[] dp = new long[scenicspot + 1];
        dp[1] = 1;
        dp[2] = 2;
        for (int i = 1; i < scenicspot + 1; i++) {
            dp[i] = dp[i - 1] + dp[i - 2];
        }
        return dp[scenicspot];
    }

}
